InitializeToolBar server-side event will be invoked when toolbar is being initialized. In this event, commands can be created, added, or removed from toolbar collection. Main toolbar collection, HTML toolbar collection, Preview toolbar collection, and floating toolbar collection will be passed as the arguments of the event.
The following is the code snippet to add a command to toolbar collection.
| C# | Copy Code |
protected void WebTextEditor1_InitializeToolBar(object sender, ISNet.WebUI.WebTextEditor.WebTextEditorToolBarArgs e) |
|
The following is the code snippet to remove a command from toolbar collection.
| C# | Copy Code |
protected void WebTextEditor1_InitializeToolBar(object sender, WebTextEditorToolBarArgs e)
|
|
A toolbar collection could contain multiple toolbars. To easily search for a specific toolbar, GetToolBarByCategory method in the event�??s argument can be used. This method can retrieve toolbar object in the collection using the category and name of toolbar.
WebTextEditorToolBar tb = e.GetToolBarByCategory(WebTextEditorToolBarCategory.Custom, "tbCustom1");
In This Section
How-to: Add Custom Command using InitializeToolBar server-side event
How-to: Remove Command using InitializeToolBar server-side event
How-to: Add Custom ToolBar using InitializeToolbar server-side event
How-to: Remove ToolBar using InitializeToolBar server-side event
Copy Code